<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
     let str = `<ul>
        <li>
            <a>金凤凰费尽心机</a>
            <p>卡卡圣马可</p>
        </li>
        <li>
            <a>维护时间还是</a>
            <p>较低级的你</p>
        </li>
    </ul>`;
    //声明正则;
    const reg = /<li>.*?<a>(.*?)<\/a>.*?<p>(.*?)<\/p>/sg
    //调用方法
    const result = str.matchAll(reg);
    const arr = [...result];

    console.log(arr);

    </script>
</body>
</html>